<template>
  <div id="app">
    <img alt="Vue logo" src="./assets/logo.png">
    <br/>
    <button @click="json">axios发送数据</button>
   
  </div>
</template>

<script>
import axios from 'axios'
// import HelloWorld from './components/HelloWorld.vue'

export default {
  name: 'App',
  components: {
    // HelloWorld
  },
  methods:{
    json() {
        axios.post('http://127.0.0.1:8000/user/getjson/',{
          ID: 9876543211
        }
      )
      .then(function (response) {
        console.log(response);
      })
      .catch(function (error) {
        console.log(error);
      })
      .then(function () {
        // always executed
      });
    }
  }
}
</script>

<style>
button{
  margin: 10px auto;
  width: 200px;
  height: 50px;
  background-color: antiquewhite;
  border-radius: 10px;
  box-shadow: yellowgreen;
}
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
